<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>后台管理系统</title>
    <link rel="icon" href="/img/logo.png" type="image/x-icon"/>
    <link rel="stylesheet" href="/layui/css/layui.css">
    <script src="/script/jquery-3.3.1.min.js"></script>
    <script src="/script/wangEditor.js"></script>
    <script src="/layui/layui.js"></script>
    <script src="/script/admin/project/free_add.js"></script>
    <script src="/layui/xm-select.js"></script>
    <script src="/script/admin/common.js"></script>
    <style type="text/css">
        #addEdit{
            color: #2a2a2a !important;
            margin-bottom: .5rem !important;
            line-height: 1.8 !important;
            font-size: 16px !important;
        }
    </style>
    <script>
        function checkLeave() {
            event.returnValue="确定离开当前页面吗？";
        }
    </script>
</head>
<body onbeforeunload="checkLeave()">
<input type="hidden" id="source" th:value="${source}">
<input type="hidden" id="projectId" th:value="${projectId}">
    <form class="layui-form" id="form" action="/admin/project/free_project_save">
        <div class="layui-form-item">
            <label class="layui-form-label">标题:</label>
            <div class="layui-input-block layui-col-md5">
                <input type="text" name="title" lay-verify="required" id="title" autocomplete="off"  placeholder="请输入标题" class="layui-input">
                <div style="margin-top: 10px;color: red;">
                    <p>项目名+玩法（活动）赚多少红包（话费或者立减金等），比如：飞猪小程序答题抽红包活动新人免费赚3元红包，亲测必中</p>
                </div>
            </div>
            <span class="layui-btn-normal layui-btn"  onclick="getKeyword()">联想</span>
            <span class="layui-btn-normal layui-btn"  onclick="toBaiduInex()">百度指数</span>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">类型:</label>
            <div class="layui-input-block layui-col-md5" >
                <th:block th:each="t:${typeList}">
                    <input type='radio'   name='type' th:title="${t.typeName}"  th:value="${t.id}" lay-filter="typeChange"  th:if="${t.selected == false}"/>
                    <input type='radio'   name='type' checked='' th:title="${t.typeName}"  th:value="${t.id}" lay-filter="typeChange"  th:if="${t.selected == true}"/>
                </th:block>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">有效期内展示标签</label>
            <div class="layui-input-block layui-col-md5">
                <input type="text" name="showLabel" id="showLabel" autocomplete="off"  placeholder="请输入标签"  class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">关键字</label>
            <div class="layui-input-block layui-col-md5">
                <input type="text" name="keyword" id="keyword" autocomplete="off"  placeholder="请输入关键字"  class="layui-input">

                <div  id="topLabelDiv" style="display: none">
                    <th:block th:each="l:${topLabels}">
                        <span class="layui-badge layui-bg-blue" th:text="${l.labelName}" th:onclick="selectTopLabel([[${l.labelName}]])"></span>
                    </th:block>
                </div>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">项目名</label>
            <div class="layui-input-block layui-col-md5">
                <input type="text" name="projectName" id="projectName" autocomplete="off"  placeholder="请输入项目名"  class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">首页轮播:</label>
            <div class="layui-input-block layui-col-md5">
                <input type="radio" name="commented" value="1" title="是" >
                <input type="radio" name="commented" value="0" title="否" checked="">
            </div>
        </div>

        <p>插入进群图：%%+关键词<br>  插入app：@@+APP关键词<br>  插入提现图：##+app关键词+提现 </p>
        <input type="text" readonly id="copy1"  autocomplete="off" class="layui-input" value="天天线报网的赚友赶紧上吧" style="width: 200px;display: inline-block;">
        <a onclick="copy1()" style="display: inline-block" class="layui-btn layui-btn-sm">复制</a>
        <div class="layui-col-md12" lay-verify="content" id="addEdit" name="content"></div>

        <div class="layui-form-item">
            <label class="layui-form-label">是否首页展示</label>
            <div class="layui-input-block layui-col-md5">
                <input type="radio" name="isHomePage" value="1" title="是" checked="">
                <input type="radio" name="isHomePage" value="0" title="否">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">主题:</label>
            <div class="layui-input-block layui-col-md2">
                <div id="subject" style="width: 350px;"></div>
            </div>
        </div>


        <div class="layui-form-item">
            <label class="layui-form-label">免费赚</label>
            <div class="layui-input-block layui-col-md5">
                <input type="text" name="profit" id="profit" autocomplete="off"  placeholder="请输入金额"  class="layui-input">
            </div>
        </div>


        <div class="layui-form-item">
            <label class="layui-form-label">是否草稿</label>
            <div class="layui-input-block layui-col-md5">
                <input type="radio" name="isTemp" value="1" title="是" >
                <input type="radio" name="isTemp" value="0" title="否" checked="">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">是否收录</label>
            <div class="layui-input-block layui-col-md5">
                <input type="radio" name="isNofollow" value="0" title="是" checked="">
                <input type="radio" name="isNofollow" value="1" title="否" >
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">伪原创</label>
            <div class="layui-input-block layui-col-md5">
                <div class="layui-btn" id="wycBtn">伪原创</div>
            </div>
        </div>

        <div class="layui-form-item" style="margin-top: 20px">
            <label class="layui-form-label">上传封面:</label>
            <div class="layui-input-block layui-col-md5">
                <button type="button" class="layui-btn" id="update_cover_btn">上传图片</button>
                <input type="hidden" id="cover_img" name="cover" lay-verify="cover" value="">
                <div class="layui-upload-list">
                    <img class="layui-upload-img" id="demo1">
                    <p id="demoText"></p>
                </div>
            </div>
        </div>

        <div class="layui-form-item layui-col-md-offset1" style="margin-bottom: 25px;">
            <div class="layui-btn" id="submit" lay-filter="form" lay-submit>提交</div>
        </div>


    </form>
</body>
</html>